### Use container inputs and outputs

The following Dagger Function creates an environment with a container input and a container output. The input is a base `alpine` container, and the output is the same container, updated with additional libraries and tools. The environment is given to an LLM with a prompt describing how it should update the container.

<Tabs groupId="language" queryString="sdk">
<TabItem value="go" label="Go">

```go file=../../../cookbook/snippets/env-use-containers/go/main.go
```

</TabItem>
<TabItem value="python" label="Python">

```python file=../../../cookbook/snippets/env-use-containers/python/main.py
```

</TabItem>
<TabItem value="typescript" label="TypeScript">

```typescript file=../../../cookbook/snippets/env-use-containers/typescript/index.ts
```

</TabItem>
<TabItem value="php" label="PHP">

```php file=../../../cookbook/snippets/env-use-containers/php/src/MyModule.php
```

</TabItem>
</Tabs>

#### Example

Have the agent update the container and open an interactive terminal to inspect the container filesystem:

<Tabs groupId="shell">
<TabItem value="System shell">
```shell
dagger -c 'agent | terminal'
```
</TabItem>
<TabItem value="Dagger Shell">
```shell title="First type 'dagger' for interactive mode."
agent | terminal
```
</TabItem>
<TabItem value="Dagger CLI">
```shell
dagger call agent terminal
```
</TabItem>
</Tabs>
